package com.seres.listener.event;

import com.seres.enums.RedisCacheEnum;
import org.springframework.context.ApplicationEvent;

import java.io.Serializable;

/**
 * @Description : 清除缓存监听器
 * @Author : 杨松
 * @Date: 2020-08-12 10:15
 */
public class ClearTableCacheEvent extends ApplicationEvent {

    private Class clz;

    private Serializable id;

    public ClearTableCacheEvent(Object source,Class clz,Serializable id) {
        super(source);
        this.clz = clz;
        this.id = id;
    }

    public String getKey(){
        return RedisCacheEnum.TABLE.createKey(clz.getSimpleName(),id);
    }
}
